package com.github.pig.admin.service.attendance.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.github.pig.admin.mapper.attendance.AttendanceGroupUserMapper;
import com.github.pig.admin.model.attendance.AttendanceGroup;
import com.github.pig.admin.model.attendance.AttendanceGroupUser;
import com.github.pig.admin.service.attendance.IAttendanceGroupUserService;
import com.github.pig.common.constant.CommonConstant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author sxf
 * @since 2018-11-22
 */
@Service
public class AttendanceGroupUserServiceImpl extends ServiceImpl<AttendanceGroupUserMapper, AttendanceGroupUser> implements IAttendanceGroupUserService {
    @Autowired
    private AttendanceGroupUserMapper groupUserMapper;
    @Override
    public AttendanceGroup getByUserName(String username) {

        List<AttendanceGroup> list = groupUserMapper.getByUserName(username);
        if(list!=null && list.size()>0){
            return list.get(0);
        }
        return null;
    }
}
